package com.angel.domain.angelvoice.aggregates;

import com.angel.domain.angelhelp.valueobjects.AngelHelpId;
import com.angel.domain.angeluser.valueobjects.AngelUserId;
import com.angel.domain.angeluser.valueobjects.CreateInfo;
import com.angel.domain.angelvoice.event.PublishAngelVoiceEvent;
import com.angel.domain.angelvoice.valueobjects.AngelVoiceId;
import com.angel.domain.angelvoice.valueobjects.AngelVoiceInfo;

/*
 * 更新关注微信公众号： 为了offer
 * @author parkin
 * @description 天使的声音（评论）
 * @date 2021/11/16
 */
public class AngelVoice {
    private AngelVoiceId angelVoiceId;
    private AngelHelpId angelHelpId;
    // 发出声音的用户
    private AngelUserId publishAngelUserId;
    private AngelVoiceInfo angelVoiceInfo;
    private CreateInfo createInfo;

    private AngelVoice() {}

    public AngelVoice(AngelHelpId angelHelpId,
                      AngelUserId publishAngelUserId,
                      AngelVoiceInfo angelVoiceInfo) {
        this(new AngelVoiceId(),angelHelpId,publishAngelUserId,angelVoiceInfo,new CreateInfo(publishAngelUserId));
    }

    public AngelVoice(AngelVoiceId angelVoiceId,
                      AngelHelpId angelHelpId,
                      AngelUserId publishAngelUserId,
                      AngelVoiceInfo angelVoiceInfo) {
        this(angelVoiceId,angelHelpId,publishAngelUserId,angelVoiceInfo,new CreateInfo(publishAngelUserId));
    }

    public AngelVoice(AngelVoiceId angelVoiceId,
                      AngelHelpId angelHelpId,
                      AngelUserId publishAngelUserId,
                      AngelVoiceInfo angelVoiceInfo,
                      CreateInfo createInfo) {
        this.angelVoiceId = angelVoiceId;
        this.angelHelpId = angelHelpId;
        this.publishAngelUserId = publishAngelUserId;
        this.angelVoiceInfo = angelVoiceInfo;
        this.createInfo = createInfo;
    }

    public PublishAngelVoiceEvent publishVoice() {
        return new PublishAngelVoiceEvent(1);
    }
}
